package me.zk.practice1.hw;

import java.util.Scanner;

/**
 * @author zhangkai
 * @date 2023/8/8 18:20
 */
public class HWBJ32 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String s = scanner.nextLine();

        s =  s.replaceAll("\"","");
        String[] strs = s.substring(1,s.length()-1).split(",");

        String temp = strs[0];
        boolean isOver = false;
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < temp.length()-1; i++) {
            char c = temp.charAt(temp.length() -1 - i);
            for (int j = 1; j < strs.length; j++) {
                String s1 = strs[j];
                if (s1.length() <= i || c!=s1.charAt(s1.length()-1-i)) {
                    isOver = true;
                    break;
                }
            }
            if (isOver) {
                break;
            }
            sb.insert(0,c);
        }



        System.out.println(sb.length()!=0 ? sb:"@Zero");
    }
}
